Ektron CMS400.Net Reference

>>Helping Users Navigate Your Web Site > Collections > Collection Server Control > Using the Collection Server Control Programmatically Example

Using the Collection Server Control Programmatically Example

The following is an example of using code behind, and a drag and drop Collection server control to display random content from a collection.

  1. Drag and drop a Collection server control on your Web form.
  2. Set the properties in the properties window.

    Note: In this example, the Random and GetHtml properties must be set to True.

  3. Add the following code to the code behind.
    Dim str As String
    str = "<h1>Hello There</h1><br>"
    str &= Collection1.EkItems(0).Html
    Collection1.Text = str
  4. Build and browse your web form.

Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.